B Binance · The world's largest crypto exchange — sign up and claim your benefits Sign up → AD
🪙 Crypto analysis tools

🧪 Crypto Strategy Backtester

Pick a coin, timeframe and period to backtest six rules (MA cross, RSI, Bollinger, MACD, Supertrend, Donchian) on real Binance candles vs buy and hold.

Loading Data: Binance public API

Strategy and costs

Decided on the bar close, filled at the next open

Backtest result

Total return
CAGR
Max drawdown (MDD)
Win rate
Profit factor
Trades
Average trade
Exposure
Final equity

Price and trades

Closed bars only · ▲ buy ▼ sell (P/L)

Where the rule stands now

Trade statistics

Average winner
Average loser
Payoff ratio (avg win ÷ avg loss)
Best trade
Worst trade
Longest losing streak
Average holding time
Return with zero costs
Return lost to costs

Equity curve

Drawdown (% below the running peak)

Trade list

# Entry Entry price Exit Exit price Return Held

Click a number to move the price chart to that trade. Fill prices include slippage; returns are after fees on both sides.

Nearby-parameter check (overfitting test)

Total return of the same test re-run with nearby parameter values. If only the centre cell looks good and its neighbours do not, the setting probably fits the past by chance. Click a cell to switch to it.

Same strategy on the top coins

Coin
Press the button to apply the current strategy, parameters, period and costs to the top coins by trading volume.

Click a coin to open its full result above.

Reading a backtest honestly

For information only, not investment advice. Data comes from exchanges' public APIs and may be delayed or interrupted. Charts: TradingView Lightweight Charts™

What this tool does

What if you had traded this rule in the past? The Crypto Strategy Backtester runs six classic trading rules — moving-average cross (golden and death cross), RSI reversal, Bollinger Band reversal, MACD cross, Supertrend and Donchian breakout — on real historical Binance candles, and puts total return, CAGR, max drawdown, win rate and profit factor side by side with simply holding the coin. Fees and slippage are included, and signals use closed bars only, so no future data leaks in.

How it is calculated

Only closed candles from Binance spot USDT markets are used. Daily tests cover the last 1, 2 or 4 years (365, 731 or 1,461 bars); 1H and 4H tests cover the last 1,000, 2,000 or 3,000 bars. A further 300 bars before the test window are loaded only to warm up the indicators (no trades there). A signal is decided on the close of bar i and filled at the open of bar i+1: buy fill = open × (1 + slippage), sell fill = open × (1 − slippage), and a fee (default 0.1%) is charged on every fill. Default slippage is 0.05% and starting capital 1,000 USDT; every trade uses all capital, long only. 'Crosses above' means A ≤ B on the previous bar and A > B on this bar. (1) MA cross: buy when the fast line (default EMA 20) crosses above the slow line (EMA 60), sell on the cross below. (2) RSI reversal: buy when RSI(14, Wilder smoothing) crosses above 30, sell when it crosses below 70. (3) Bollinger reversal: with bands = 20-bar SMA ± 2 × population standard deviation, buy when the close crosses above the lower band and sell when the close ≥ the middle band (or the upper band if chosen); if both happen on one bar, the sell wins. (4) MACD cross: buy when MACD (EMA 12 − EMA 26) crosses above its signal line (9-period EMA of MACD), optionally only while MACD < 0; sell on the cross below. (5) Supertrend (ATR 10, factor 3): buy on the bar where the direction flips from down to up, sell where it flips from up to down. (6) Donchian breakout: buy when the close > the highest high of the previous 20 bars, sell when the close < the lowest low of the previous 10 bars. Total return = final equity ÷ starting capital − 1 (an open position is marked at the last close); CAGR = (final ÷ start)^(1 ÷ years) − 1, where years = time from the first bar's open to the last bar's close ÷ 365.25 days, hidden for periods under 3 months; MDD = the largest fall of equity from its running peak; win rate = winning trades ÷ closed trades; profit factor = sum of winning trade returns ÷ sum of losing trade returns; payoff ratio = average win ÷ average loss; exposure = bars in a position ÷ all bars. Trade returns are after fees and slippage. Buy & hold buys at the first test bar's open with the same fee and slippage and is marked at the last close.

Things to know

Frequently asked questions

Does it secretly use future data?

No. Signals are computed from closed bars up to the signal bar's close, and fills happen at the next bar's open; the still-forming bar is never used. Real fills can be worse than the open in thin order books or fast moves, so a generous slippage setting is closer to reality.

My TradingView strategy tester gives different results.

Start date, fill method (next bar's open here), fees and slippage, position sizing (all capital, compounded) and the profit factor definition (sum of trade returns here) all change the numbers. The indicators themselves follow TradingView's definitions, including how EMA, RSI and ATR are seeded, so with matching settings the signals land on the same bars in almost all cases.

Can it short or use leverage?

No. It is long-only spot. On a sell signal it sells everything and waits in cash for the next buy signal. Futures, leverage and scaling in are not modelled.

What fee and slippage should I use?

Enter the real fee for your exchange and tier; Binance spot's base fee is 0.1%. Slippage of around 0.05% suits large coins; use more for thinly traded coins or short timeframes. 'Return lost to costs' in the trade statistics shows the impact at a glance.

When does the result update, and how is the KRW amount calculated?

Every minute the page checks whether a new bar has closed; when one has, it reloads the data and recalculates everything. The KRW figure for final equity is the USDT amount times Bithumb's USDT/KRW rate (Upbit if Bithumb fails), a reference only; it can differ from Korean exchange prices, which include the kimchi premium.

For information only, not investment advice. Data comes from exchanges' public APIs and may be delayed or interrupted.

📚 Worth reading
🚪Breakouts vs. Fakeouts: How to Tell Them Apart, and the Limits of Doing So 〰️How to Read Moving Averages: SMA vs EMA and the Golden Cross Track Record 📈How to Read RSI: What 70 and 30 Mean and What Real Data Says About Overbought 📊How to Read MACD: MACD Line, Signal Line, Histogram and Zero Line
← All crypto tools